package koction.model.rank;
import java.util.List;
import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class RankDAOImpl implements RankDAO 
{
	
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	
	public String checkKeyword(String keyword) throws Exception
	{
		return (String)sqlSessionTemplate.selectOne("rank.checkKeyword", keyword);
	}
	public void insertKeyword(String keyword) throws Exception 
	{
		
		if(keyword==""){
			System.out.println("검색어 없음 null");
		}else{
		sqlSessionTemplate.insert("rank.insertKeyword", keyword);
		}
	}
	public void updateKeyword(String keyword) throws Exception 
	{
		sqlSessionTemplate.update("rank.updateKeyword", keyword);
	}
	public List<RankVO> getAllKeywordList() throws Exception 
	{
		return sqlSessionTemplate.selectList("rank.getAllKeywordList");
	}
}
